#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
#include "pqueue.h"
#include "random.h"
#include "primkruskal.h"
#include "warshalfloyd.h"
#include "knapsack.h"
#include "helpers.h"

main(){
	int **graph, graphSize, flag = 0, choice;
	char c;
	graphSize=0;
	

	printf("Lab 2 - Team Bjoern\n\n");
	
	while(TRUE){
		printf("1. Prim's algorithm\n");
		printf("2. Kruskal's algorithm\n");
		printf("3. Warshall's algorithm\n");
		printf("4. Floyds's algorithm\n");
		printf("5. Knapsack\n");
	//	printf("6. Load file\n");
		
		printf("0. Quit\n");

		scanf("%d", &choice);
		do {
			c = getchar();
			} while (c != EOF && c != '\n');

		if(choice == 0) break;

		switch(choice){
			case 1:
				graph = readGraph(&graphSize);
				prim(graph, graphSize);
				break;
			case 2:
				graph = readGraph(&graphSize);
				kruskal(graph, graphSize);
				break;
			case 3:
				graph = readGraph(&graphSize);
				warshall(graph, graphSize);
				break;
			case 4:
				graph = readGraph(&graphSize);
				floyd(graph, graphSize);
				break;
			case 5:
				knapsack();
				break;
			default:
				break;
		}

		
	}
}
